/********************************************************************
FileName    :   Bll_TempStorageH.cs
CreateTime  :   2019-01-17 01:01
BaseClass   :   Bll_TempStorageH
FileType    :   .cs
Author      :  minjie
Description :   Bll_TempStorageHBLL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Collections.Generic;

using System.Data;
using HT.DAL;
namespace HT.BLL
{
	/// <summary>
	/// Bll_TempStorageH的摘要说明。
	/// </summary>
public partial class   Bll_TempStorageH 
  	{ 
     		      
  		private readonly Dal_TempStorageH dal=new  Dal_TempStorageH(); 
  		public  Bll_TempStorageH() 
  		{} 
  		 
  		#region  Method 
     		      
  		public bool Exists() 
  		{ 
  			return dal.Exists(); 
  		} 
  		 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public bool  Add(TempStorageH_Entity model) 
  		{ 
  			return dal.Add(model); 
  		} 
   
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  string  AddStr(TempStorageH_Entity model) 
  		{ 
  			return dal.AddStr(model); 
  		} 
   
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(TempStorageH_Entity model) 
  		{ 
  			return dal.Update(model); 
  		} 
   
  		/// <summary> 
  		/// 更新一条数据(字符串) 
  		/// </summary> 
  		public string UpdateStr(TempStorageH_Entity model) 
  		{ 
  			return dal.UpdateStr(model); 
  		} 
   
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete() 
  		{ 
  			 
  			return dal.Delete(); 
  		} 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string lists ) 
  		{ 
  			return dal.DeleteList(lists ); 
  		} 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public TempStorageH_Entity GetModel() 
  		{ 
  			 
  			return dal.GetModel(); 
  		} 
   
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			return dal.GetList(strWhere); 
  		} 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			return dal.GetList(Top,strWhere,filedOrder); 
  		} 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public List<TempStorageH_Entity> GetModelList(string strWhere) 
  		{ 
  			DataSet ds = dal.GetList(strWhere); 
  			return DataTableToList(ds.Tables[0]); 
  		} 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public List<TempStorageH_Entity> GetModelList(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			DataSet ds = dal.GetListByPage(strWhere, orderby, startIndex, endIndex); 
  			return DataTableToList(ds.Tables[0]); 
  		} 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public List<TempStorageH_Entity> DataTableToList(DataTable dt) 
  		{ 
  			List<TempStorageH_Entity> modelList = new List<TempStorageH_Entity>(); 
  		  if (dt!=null ) 
  		  { 
  			int rowsCount = dt.Rows.Count; 
  			if (rowsCount > 0) 
  			{ 
  				TempStorageH_Entity   model; 
  				for (int n = 0; n < rowsCount; n++) 
  				{ 
  					model = new TempStorageH_Entity();					 
  				if(dt.Rows[n]["tempDjh"]!=null&&dt.Rows[n]["tempDjh"].ToString()!="") 
  				{ 
  					model.tempDjh=int.Parse(dt.Rows[n]["tempDjh"].ToString()); 
  				} 
  				model.Khbh= dt.Rows[n]["Khbh"].ToString(); 
  				model.Khmc= dt.Rows[n]["Khmc"].ToString(); 
  				model.Yyybh= dt.Rows[n]["Yyybh"].ToString(); 
  				model.Yyymc= dt.Rows[n]["Yyymc"].ToString(); 
  				if(dt.Rows[n]["Sl"]!=null&&dt.Rows[n]["Sl"].ToString()!="") 
  				{ 
  					model.Sl=int.Parse(dt.Rows[n]["Sl"].ToString()); 
  				} 
  				if(dt.Rows[n]["Je"]!=null&&dt.Rows[n]["Je"].ToString()!="") 
  				{ 
  					model.Je=decimal.Parse(dt.Rows[n]["Je"].ToString()); 
  				} 
  				if(dt.Rows[n]["temptime"]!=null&&dt.Rows[n]["temptime"].ToString()!="") 
  				{ 
  					model.temptime=DateTime.Parse(dt.Rows[n]["temptime"].ToString()); 
  				} 
  				 
  					modelList.Add(model); 
  				} 
  			} 
  		} 
  			return modelList; 
  		} 
   
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetAllList() 
  		{ 
  			return GetList(""); 
  		} 
   
  		/// <summary> 
  		/// 批量处理 
  		/// </summary> 
  		public int ExecuteSqlTran(List<string> ls,ref string error ) 
  		{ 
  			return dal.ExecuteSqlTran(ls,ref   error); 
  		} 
   
  		/// <summary> 
  		/// 直接执行sql语句 
  		/// </summary> 
  		public int ExecuteSql(string sql) 
  		{ 
  			return dal.ExecuteSql(sql); 
  		} 
   
  		/// <summary> 
  		/// 直接执行sql语句 
  		/// </summary> 
  		public string GetSingle(string sql) 
  		{ 
  			return dal.GetSingle(sql); 
  		} 
   
  		/// <summary> 
  		/// 直接执行sql语句 
  		/// </summary> 
  		public DataTable ExecuteDt(string sql) 
  		{ 
  			return dal.ExecuteDt(sql); 
  		} 
   
  		/// <summary> 
  		/// 获取记录总数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			return  dal.GetRecordCount(strWhere); 
  		} 
  #endregion 
      
  	} 
  
}
